package com.first.agent.service.impl;

import com.first.agent.common.R;
import com.first.agent.dao.FinancialManagementDao;
import com.first.agent.dao.impl.FinancialManagementDaoImpl;
import com.first.agent.service.FinancialManagementService;

import java.sql.SQLException;

public class FinancialManagementServiceImpl implements FinancialManagementService {
    private FinancialManagementDao financialManagementDao = new FinancialManagementDaoImpl();

    @Override
    public R FinancialManagement(String user_name, Integer fil_type_id, Double financial_funds, String remark) {
        R r = new R();
        try {
            int result=financialManagementDao.FinancialManagement(user_name,fil_type_id,financial_funds,remark);//定义响应返回值，如果不为空，则添加成功
            if (result>0){
                r.setCode(200);
                r.setMsg("添加类型成功");
            }
        } catch (SQLException e) {
            e.printStackTrace();
            r.setCode(500);
            r.setMsg("系统开小差了");
        }
        return r;
    }
}
